var LinkedInInsightTag_RS=function(e){"use strict";let t=4;const r={setLogLevel(e){switch(e.toUpperCase()){case"INFO":t=1;break;case"DEBUG":t=2;break;case"WARN":t=3;break;default:t=4}},info(...e){t<=1&&console.info(...e)},debug(...e){t<=2&&console.log(...e)},warn(...e){t<=3&&console.warn(...e)},error(...e){t<=4&&console.error(...e)}},n="RS_JS_SDK",o=["Request failed with status:"],a=e=>{var t;const r=null===(t=window.RudderStackGlobals)||void 0===t?void 0:t.errorReporting;r&&e instanceof Error&&r.notify(e)},i=e=>{const t=[];return function(e,n){if("object"!=typeof n||null===n)return n;for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(n)?(r.debug(`Circular Reference detected for key: ${e}`),"[Circular Reference]"):(t.push(n),n)}},s=(e,t)=>{try{return JSON.stringify(e,i())}catch(e){return r.warn("Failed to convert the value to a JSON string."),null}},c=(e,t,i)=>{let c;try{c=((e,t,r)=>{let o;try{o="string"==typeof e?e:e instanceof Error||e.message?e.message:s(e)}catch(e){o=""}if("object"==typeof(a=e)&&null!==a&&"target"in a){if(e.target&&"script"!==e.target.localName)return"";if(e.target.dataset&&(e.target.dataset.loader!==n||"true"!==e.target.dataset.isnonnativesdk))return"";if(o=`error in script loading:: src:: ${e.target.src} id:: ${e.target.id}`,"ad-block"===e.target.id)return r.page("RudderJS-Initiated","ad-block page request",{path:"/ad-blocked",title:o},r.sendAdblockPageOptions),""}var a;return`[handleError]:: "${o}"`})(e,0,i)}catch(t){r.error("[handleError] Exception:: ",t),r.error("[handleError] Original error:: ",s(e)),a(t)}c&&(r.error(c),(e=>!e.message||!o.some((t=>e.message.includes(t))))(e)&&a(e))},u={LOG:{value:0,method:console.log},INFO:{value:1,method:console.info},DEBUG:{value:2,method:console.debug},WARN:{value:3,method:console.warn},ERROR:{value:4,method:console.error}};function l(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function f(e){return function t(r){return 0===arguments.length||l(r)?t:e.apply(this,arguments)}}function d(e){return function t(r,n){switch(arguments.length){case 0:return t;case 1:return l(r)?t:f((function(t){return e(r,t)}));default:return l(r)&&l(n)?t:l(r)?f((function(t){return e(t,n)})):l(n)?f((function(t){return e(r,t)})):e(r,n)}}}const p=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)};function g(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}function y(e,t,r){for(var n=0,o=r.length;n=0;)h(t=j[r],e)&&!I(n,t)&&(n[n.length]=t),r-=1;return n})):f((function(e){return Object(e)!==e?[]:Object.keys(e)})),S=f((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}));function k(e,t,r,n){var o=g(e);function a(e,t){return w(e,t,r.slice(),n.slice())}return!y((function(e,t){return!y(a,t,e)}),g(t),o)}function w(e,t,r,n){if(v(e,t))return!0;var o,a,i=S(e);if(i!==S(t))return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof t["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t)&&"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof t.equals)return"function"==typeof e.equals&&e.equals(t)&&"function"==typeof t.equals&&t.equals(e);switch(i){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===(o=e.constructor,null==(a=String(o).match(/^function (\w*)/))?"":a[1]))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!v(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!v(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var s=r.length-1;s>=0;){if(r[s]===e)return n[s]===t;s-=1}switch(i){case"Map":return e.size===t.size&&k(e.entries(),t.entries(),r.concat([e]),n.concat([t]));case"Set":return e.size===t.size&&k(e.values(),t.values(),r.concat([e]),n.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var c=E(e);if(c.length!==E(t).length)return!1;var u=r.concat([e]),l=n.concat([t]);for(s=c.length-1;s>=0;){var f=c[s];if(!h(f,t)||!w(t[f],e[f],u,l))return!1;s-=1}return!0}var N=d((function(e,t){return w(e,t,[],[])}));var R=f((function(e){return null!=e&&"function"==typeof e["fantasy-land/empty"]?e["fantasy-land/empty"]():null!=e&&null!=e.constructor&&"function"==typeof e.constructor["fantasy-land/empty"]?e.constructor["fantasy-land/empty"]():null!=e&&"function"==typeof e.empty?e.empty():null!=e&&null!=e.constructor&&"function"==typeof e.constructor.empty?e.constructor.empty():p(e)?[]:function(e){return"[object String]"===Object.prototype.toString.call(e)}(e)?"":function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e)?{}:m(e)?function(){return arguments}():function(e){var t=Object.prototype.toString.call(e);return"[object Uint8ClampedArray]"===t||"[object Int8Array]"===t||"[object Uint8Array]"===t||"[object Int16Array]"===t||"[object Uint16Array]"===t||"[object Int32Array]"===t||"[object Uint32Array]"===t||"[object Float32Array]"===t||"[object Float64Array]"===t||"[object BigInt64Array]"===t||"[object BigUint64Array]"===t}(e)?e.constructor.from(""):void 0})),L=f((function(e){return null!=e&&N(e,R(e))}));const B=(e,t="from",r="to",n=!0)=>{const o={};return Array.isArray(e)&&e.forEach((e=>{if(!("object"==typeof(a=e[t])||"string"==typeof a?!L(a):L(a)))return;var a;if("string"!=typeof e[t])return;const i=n?e[t].toLowerCase().trim():e[t].trim();if(o[i]){o[i].includes(e[r])||o[i].push(e[r])}else o[i]=[e[r]]})),o},U=new class{constructor(e,t){this.level=+t||u.ERROR.value,this.scope=e||""}setLogLevel(e){if(e&&"string"==typeof e){const t=e.toUpperCase();this.level=u[t]?u[t].value:this.level}}setScope(e){this.scope=e||this.scope}log(...e){this.logBase(e,u.LOG.value)}info(...e){this.logBase(e,u.INFO.value)}debug(...e){this.logBase(e,u.DEBUG.value)}warn(...e){this.logBase(e,u.WARN.value)}error(...e){this.logBase(e,u.ERROR.value)}logBase(e,t){if(this.level<=t){Object.values(u).find((e=>e.value===t)).method(...this.getLogData(e))}}getLogData(e){if(Array.isArray(e)&&e.length>0){let t="%c RS SDK";this.scope&&(t=`${t} - ${this.scope}`);t=`${t} %c ${e[0].trim()}`;const r=[];return r.push(t),r.push("font-weight: bold; background: black; color: white;"),r.push("font-weight: normal;"),r.push(...e.slice(1)),r}return e}}("Linkedin Insight Tag");return e.LinkedInInsightTag=class{constructor(e,t,r){t.logLevel&&U.setLogLevel(t.logLevel),this.analytics=t,this.name="LINKEDIN_INSIGHT_TAG",this.partnerId=e.partnerId,this.eventToConversionIdMap=e.eventToConversionIdMap,({shouldApplyDeviceModeTransformation:this.shouldApplyDeviceModeTransformation,propagateEventsUntransformedOnError:this.propagateEventsUntransformedOnError,destinationId:this.destinationId}=null!=r?r:{})}init(){((e,t,r={})=>{try{if(document.getElementById(e))return;const o=document.createElement("script");o.src=t,o.async=void 0===r.async||r.async,o.type="text/javascript",o.id=e,!0!==r.skipDatasetAttributes&&(o.setAttribute("data-loader",n),void 0!==r.isNonNativeSDK&&o.setAttribute("data-isNonNativeSDK",r.isNonNativeSDK));const a=document.getElementsByTagName("head");if(a.length>0)a[0].insertBefore(o,a[0].firstChild);else{const e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(o,e)}}catch(e){c(e)}})("LinkedIn Insight Tag","https://snap.licdn.com/li.lms-analytics/insight.min.js"),this.partnerId&&(window._linkedin_data_partner_id=this.partnerId)}isLoaded(){return!!window._linkedin_data_partner_id}isReady(){return this.isLoaded()}track(e){const{message:t}=e,{event:r}=t;if((e=>(e=>null===e)(e)||(e=>void 0===e)(e))(r))return void U.error("Event name is either null or undefined");if("string"!=typeof r)return void U.error("Event name should be a string");const n=r.trim(),o=B(this.eventToConversionIdMap,"from","to",!1);if(!o[n])return void U.warn(`The "${r}" event is not mapped in the destination dashboard. It'll be skipped`);(o[n]||[]).forEach((e=>{window.lintrk("track",{conversion_id:e})}))}},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),e}({}); //# sourceMappingURL=LinkedInInsightTag.min.js.map